import multiprocessing
import time
def sing(num):
    for i in range(num):
        print("唱歌...")
        time.sleep(0.5)
def dance(num):
    for i in range(num):
        print("跳舞...")
        time.sleep(0.5)

if __name__=='__main__':
    #使用进程类创建进程对象
    #target：指定进程执行的函数名
    #args:使用元组方式给指定任务传参
    #kwargs:使用字典方式给指定任务传参
    sing_process = multiprocessing.Process(target=sing,args=(3,))
    dance_process = multiprocessing.Process(target=dance,kwargs={'num':3})
    sing_process.start()
    dance_process.start()

